<!doctype html>
<html>
<head>
    <title>{$backend_name}-{$code_name}</title>
    <meta name="description" content="">
    {include file="public/head"}
</head>
<body>
<!--header-->
{include file="public/header"}
<div class="tpl-page-container tpl-page-header-fixed">
    <!--menu-->
    {include file="public/menu"}
    <!--html body-->
    <div class="tpl-content-wrapper">
        <!--nav-->
        <div class="tpl-content-page-title">
            {$code_name}
        </div>
        <ol class="am-breadcrumb">
            <li><a href="{:url('index/index')}" class="am-icon-home">首页</a></li>
            <li><a href="{:url('active/index')}">活动</a></li>
            <li class="am-active">{$code_name}</li>
        </ol>
        <!--content-->
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> {$code_name}列表
                </div>
                <!--<div class="tpl-portlet-input tpl-fz-ml">
                    <div class="portlet-input input-small input-inline">
                        <div class="input-icon right">
                            <i class="am-icon-search"></i>
                            <input type="text" class="form-control form-control-solid" placeholder="搜索..."></div>
                    </div>
                </div>-->
            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-md-6">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <a href="{:url($code.'/get_new',['active_id'=>$active_id])}" class="am-btn am-btn-default am-btn-success"><span
                                        class="am-icon-plus"></span> 新增
                                </a>
                                <a href="{:url('reward_log/index',['active_id'=>$active_id])}" class="am-btn am-btn-default am-btn-secondary"><span
                                        class="am-icon-archive"></span> 中奖记录
                                </a>
                                <!--<button type="button" class="am-btn am-btn-default am-btn-danger"><span
                                        class="am-icon-trash-o"></span> 删除
                                </button>
                                <button type="button" class="am-btn am-btn-default am-btn-warning to_excel"><span
                                        class="am-icon-archive"></span> 导出Excel
                                </button>-->
                            </div>
                        </div>
                    </div>
                    <!--<div class="am-u-sm-12 am-u-md-3">
                        <div class="am-form-group">
                            <select data-am-selected="{btnSize: 'sm'}" name="status">
                                <option value="all">所有状态</option>
                            </select>
                        </div>
                    </div>-->
                    <div class="am-u-sm-12 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                            <input type="text" class="am-form-field" name="keywords" value="">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
                            </span>
                        </div>
                    </div>
                </div>
                <div class="am-g" style="margin-top:20px;">
                    <div class="am-u-sm-12">
                        <form class="am-form">
                            <table class="am-table am-table-striped am-table-hover table-main">
                                <thead>
                                <tr>
                                    <!--<th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>-->
                                    <th>#</th>
                                    <th>奖品名称</th>
                                    <th>奖品数量</th>
                                    <th>剩余数量</th>
                                    <th>奖品排序</th>
                                    <th>奖品状态</th>
                                    <th>创建时间</th>
                                    <th>更新时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $list as $vo}
                                <tr>
                                    <!--<td><input type="checkbox"></td>-->
                                    <td>{$vo.id}</td>
                                    <td><a href="{:url($code.'/get_edit',['id'=>$vo.id,'active_id'=>$vo.active_id])}">{$vo.name}</a></td>
                                    <td>{$vo.number}</td>
                                    <td>{$vo.current_number}</td>
                                    <td>{$vo.sort}</td>
                                    <td>
                                        {if condition="$vo.status == 1"}
                                        <span class="am-badge am-badge-success am-radius">可用</span>
                                        {else/}
                                        <span class="am-badge am-badge-danger am-radius">不可用</span>
                                        {/if}
                                    </td>
                                    <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                                    <td>{$vo.update_time|date='Y-m-d H:i:s',###}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                   href="{:url($code.'/get_edit',['id'=>$vo.id,'active_id'=>$vo.active_id])}">
                                                    <span class="am-icon-pencil-square-o"></span> 编辑
                                                </a>
                                                <!--<button class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span> 复制</button>-->
                                                <!--<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>-->
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                            <div class="am-cf">
                                <div class="am-fr">
                                    {$page}
                                </div>
                            </div>
                            <hr>

                        </form>
                    </div>
                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>
    </div>
</div>
<!--js-->
{include file="public/js"}
<script type="text/javascript">
    $('.am-icon-search').click(function(){
        var keywords = $('input[name=keywords]').val();
        window.location.href = '{:url($code."/index",["active_id"=>$active_id])}?keywords='+keywords;
    });

</script>
</body>
</html>